package com.udf.hive.udf;


import com.udf.hive.unit.StringUtils;
import org.apache.hadoop.hive.ql.exec.UDF;

public class IdNum2City extends UDF {
    private static IdNum2Address idNum2Address = new IdNum2Address();

    public String evaluate(String input) {
        String addrStr = idNum2Address.evaluate(input);
        return StringUtils.parseCity(addrStr);
    }

    public static void main(String[] args) {
        IdNum2City idNum2City = new IdNum2City();
        System.out.println(idNum2City.evaluate("411424198905256630"));
        System.out.println(idNum2City.evaluate("上海市浦东新区"));
        System.out.println(idNum2City.evaluate("上海市"));
    }
}
